<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
use app\modules\Order\models\Order;

$order =  Order::findOne($order_id);

$this->title =  "订单 : " .$order->product->name;  //Yii::t('app.order', 'Order Customers');
?>
<div class="order-customer-index">
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <h2 class="page-header"><small><?= Html::encode($this->title) ?></small>
        <p class="pull-right"><?= Html::a(Yii::t('app.order', 'Create Order Customer'), ['create', 'order_id'=>$order_id], ['class' => 'btn btn-success']) ?></p>
    </h2>
<?php Pjax::begin(); ?>    
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            //['class' => 'yii\grid\SerialColumn'],

            //'id',
            //'order_id',
            'first_name',
            'last_name',
            // 'en_first_name',
            // 'en_last_name',
            // 'pinyin',
            [
                'attribute' => 'gender',
                'filter' => Yii::$app->params['gender'],
                'value' => function ($model) {
                    return Yii::$app->params['gender'][$model->gender];
                },
            ],
            // 'birthday',
            // 'country',
            'passport',
            // 'passport_add',
            // 'passport_date',
            [
                'attribute' => 'passport_type',
                'filter' => Yii::$app->params['passport_type'],
                'value' => function ($model) {
                    return Yii::$app->params['passport_type'][$model->passport_type];
                },
            ],
             'phone',
            // 'remark',
            // 'status',
            // 'user_id',
            // 'created_at',
            // 'updated_at',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
<?php Pjax::end(); ?></div>
